<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/editTablestyles.css" />
<script type="text/javascript" src="${pageContext.request.contextPath }/webjars/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/listTable.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<link href="css/font-awesome.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800" rel="stylesheet">
</head>
<body>
<div class="main-banner" id="home">
	<div class="banner-info">
			<div class="w3pvt-logo text-center">
                <h1> <a href="">会员详情</a></h1>
            </div>
            <div class="middile-inner-con">
                <div class="tab-main mx-auto">

                    <!-- <input id="tab1" type="radio" name="tabs" class="w3layouts-sm" checked>
                    <label for="tab1"><span class="fa fa-home" aria-hidden="true"></span>Home</label>

                    <input id="tab2" type="radio" class="w3layouts-sm" name="tabs">
                    <label for="tab2"><span class="fa fa-users" aria-hidden="true"></span> Update</label> -->

                    <ul>
                    	<li><img src="${user.head }" class="admin img-fluid" alt="头像"></li>
                    </ul>
                        <form action="user.action?methodName=doUpdateUser" method="post">
							<table class="querytable">
								<tr>
									<td class="textright">用户名：</td>
									<td class="textleft">
									<input type="text" name="username" value="${user.username }"/>
									<input type="hidden" name="userid"  value="${user.userid }"/>
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="textright">密码：</td>
									<td  class="textleft">
									<input type="password" name="password" />
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="textright">确认密码：</td>
									<td  class="textleft">
									<input type="password" name="againPassword" />
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="textright">用户角色：</td>
									<td  class="textleft">
									
									<select name="userroles" id="">
									<option value="">--请选择--</option>
									<option value="1"  <c:if test="${user.userroles eq '1'}">selected=selected</c:if>>管理员</option>
									<option value="2"  <c:if test="${user.userroles eq '2'}">selected=selected</c:if>>普通用户</option>
									</select>
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="textright">昵称：</td>
									<td class="textleft">
									<input type="text" name="nickname"  value="${user.nickname }"/>
									</td>
									<td></td>
								</tr>
								<tr>
									<td class="textright">手机号</td>
									<td class="textleft">
									<input type="text" name="telphone"  value="${user.telphone }"/>
									</td>
									<td></td>
								</tr>
								<tr>
									<td colspan="3" align="center">
									<input type="submit" value="修改用户信息" />
									</td>
								</tr>
							</table>
						</form>
                </div>
             </div>
	</div>
</div>
</body>
<script type="text/javascript">
	$(function() {
		$("input[type='submit']").click(function() {
			var uname=$("input[name='username']").val();
			if(uname==""){
				alert("请输入用户名！");
				return false;
			}
			var pwd=$("input[name='password']").val();
			if(pwd==""){
				alert("请输入密码！");
				return false;
			}
			var apwd=$("input[name='againPassword']").val();
			if(apwd==""){
				alert("请再次输入密码！");
				return false;
			}
			if (pwd!=apwd) {
				alert("两次密码不一致");
				return false;
			}
			var userroles=$("input[name='userroles']").val();
			if(userroles==0){
				alert(userroles);
				alert("请选择角色！");
				return false;
			}
			var nickname=$("input[name='nickname']").val();
			if(nickname==""){
				alert("请输入昵称！");
				return false;
			}
			var telphone=$("input[name='telphone']").val();
			if(telphone==""){
				alert("请输入手机号！");
				return false;
			}
		});
	});


</script>
</html>